
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>编辑非上市公司指数</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/css/global.css" media="all">
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/plugins/font-awesome/css/font-awesome.min.css">

    <style>
        .layui-form-label {
            width: 10%;
        }
        .layui-input-block {
            margin-left: 13%;
        }
        img {
            width: 200px;
            height: 120px;
        }
        .layui-upload-list {
            margin-left: 13%;
        }
    </style>
</head>

<body>
<div style="margin: 15px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>编辑非上市公司指数(<label class="layui-required-tip">标红的为必填项</label>)</legend>
        <!-- <div class="layui-input-block">
            <a href="javascript:history.back();" class="layui-btn" style="float: right;">返回</a>
        </div> -->
    </fieldset>
	<form class="layui-form" action="">
	  <div class="layui-form-item">
	    <label class="layui-form-label layui-required-tip">平台名称</label>
	    <div class="layui-input-block">
	      <input type="text" name="platformName" id="platformName" maxlength="100" required value="${data.platformName!}"  lay-verify="required" placeholder="请输入平台名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label layui-required-tip">企业名称</label>
	    <div class="layui-input-block">
	      <input type="text" name="enterpriseName" id="enterpriseName" maxlength="100" required value="${data.enterpriseName!}"  lay-verify="required" placeholder="请输入企业名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label layui-required-tip">上线时间</label>
	    <div class="layui-input-block">
	      <input type="text" name="onlineTime" id="onlineTime" maxlength="50" readonly="readonly" value="${data.onlineTime!?string('yyyy-MM-dd HH:mm:ss')}" required  lay-verify="required" placeholder="请输入上线时间" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	   
	  <div class="layui-form-item">
	    <label class="layui-form-label layui-required-tip">所在城市</label>
	    <div class="layui-input-block">
                <select name="cityId" lay-verify="required" id="cityId" lay-search>  
                    <option value="">直接选择或搜索选择</option>
                    <#if cityList?? >
							<#list cityList as ct>
							<#if (data.cityId??) &&  (data.cityId==ct.id)>
									<option value="${ct.id}" selected>${ct.name!}</option>
									<#else>
									<option value="${ct.id}">${ct.name!}</option>
								</#if>
							</#list>
						</#if>
                </select>  
	    </div>
	  </div>
	  
	<div class="layui-form-item">
	    <label class="layui-form-label layui-required-tip">指数</label>
	    <div class="layui-input-block">
	      <input type="text" name="index" id="index" maxlength="10" required value="${data.index!}"  lay-verify="required|number" placeholder="请输入指数" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item"style="display: none">
	    <label class="layui-form-label">状态</label>
	    <div class="layui-input-block">
	      <#if  (data.enableFlag)?? && data.enableFlag==true>
			<input type="radio" name="enableFlag" value="1" title="启用" checked/>
			<input type="radio" name="enableFlag" value="0" title="停用" />
		<#else>
			<input type="radio" name="enableFlag" value="1" title="启用" />
			<input type="radio" name="enableFlag" value="0" title="停用" checked/>
		</#if>
						
		  </div>
		  </div>
	  
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit lay-filter="formSubmit">立即提交</button>
	      <button type="button" onclick="javascript:history.back();" class="layui-btn layui-btn-primary">返回</button>
	      <input type="hidden" name="id" value="${data.id}"/>
	    </div>
	  </div>
	</form>
	</div>


 <script type="text/javascript" src="/plugins/layui/layui.js"></script>
<script>
//Demo
layui.use(['form','layer','laydate'], function(){
  var upload = layui.upload
  ,form=layui.form
  ,laydate = layui.laydate
  ,layer = layui.layer //弹层
  ,$=layui.jquery;
  
//上线时间
  laydate.render({
    elem: '#onlineTime',
    type: 'datetime'
  });
 
  //监听提交
  form.on('submit(formSubmit)', function(data){
	  data.field.cityName= $("#cityId").find("option:selected").text();
	  $.ajax({
          type : "POST",
          url : "/manage/index/updateNonListedCompanyIndex",
          dataType : "json",
          data :data.field,
          success : function(data) {
        	  layer.alert(data.msg, {
        		    skin: 'layui-layer-molv' //样式类名  自定义样式
        		    ,closeBtn: 1    // 是否显示关闭按钮
        		    ,anim: 1 //动画类型
        		    ,btn: ['确定'] //按钮
        		    ,icon: data.code>=0?1:2    // icon
        		    ,yes:function(index){
        		    	if (data.code >= 0) {
        	                  location.href = "/manage/index/nonListedCompanyIndexList";
        	              }else{
        	            	  layer.close(index);
        	              }
        		    }});
          },
          error : function() {
              alert("系统异常,请稍后重试");
          }
      });
    return false;
  }); 

});
</script>

</body>
</html>
      